import React from 'react'
import { Outlet, Navigate, useLocation } from 'umi'
import { isLogin } from '@/utils'
export default function auth() {
  const location = useLocation();  
  return (
    <>
      {
        isLogin()
        ?
        <Outlet/>
        :
        <Navigate to={`/login?from=${location.pathname}`}/>
      }
      
    </>
  )
}
